# -*- coding: utf-8 -*-
"""
------------------------------------------------------------------------------
    File Name:  random_deom
    Author   :  wanwei1029
    Date     :  2018-10-12
    Desc     :
------------------------------------------------------------------------------
"""
import numpy as np


def demo():
    """
    """
    # 默认为生成一个随机的浮点数，范围是在0.0~1.0之间，也可以通过参数size设置返回数据的size
    print("np.random.random()")
    print(np.random.random())
    print("np.random.random(size=(3, 2))")
    print(np.random.random(size=(3, 2)))
    print("np.random.rand()")
    print(np.random.rand())
    # numpy.random.randint()随机生一个整数int类型，可以指定这个整数的范围
    # 如果high为None,则聚会范围为[0,low),也就是把low当成了high
    print("np.random.randint(8)")
    print(np.random.randint(8))
    print("np.random.randint(5, size=3)")
    print(np.random.randint(5, size=3))
    print("np.random.randint(5, 9, size=(3, 2))")
    print(np.random.randint(5, 9, size=(3, 2)))
    # numpy.random.normal(loc=0.0, scale=1.0, size=None) 　高斯分布随机数
    # loc：均值，scale：标准差，size：抽取样本的size
    print("np.random.normal(loc=0.0, scale=1, size=(2, 3))")
    print(np.random.normal(loc=0.0, scale=1, size=(2, 3)))


if __name__ == '__main__':
    test_method = "demo"
    if test_method == "demo":
        demo()
